package com.oliver.picturebackenduserservice.controller.inner;

import com.oliver.picturebackendmodel.model.entity.User;
import com.oliver.picturebackendopenfign.feignClient.UserFeignClient;
import com.oliver.picturebackenduserservice.service.UserService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;

/**
 * @ClassName UserInnerController
 * @Description TODO
 * @Author snow
 * @Date 2025/1/26 21:41
 **/

@RestController
@RequestMapping("/inner")
@Api(tags = "用户注册-openFeign")
public class UserInnerController implements UserFeignClient {

    @Resource
    private UserService userService;

    @Override
    @GetMapping("/get/id")
    public User getById(@RequestParam("userId") Long userId){
        return userService.getById(userId);
    }

    @Override
    @GetMapping("/get/ids")
    public List<User> listByIds(@RequestParam("userIdSet") Collection<Long> userIdSet){
        return userService.listByIds(userIdSet);
    }
}
